package com.gopay.scheduler.common;

import java.io.InputStream;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;

public class OrderLifecycleUtil {
	public static final String B2B="-B2B";
	public static final String B2C="-B2C";
	public static final String OFFLINE="-offline";
	
	public static String getLifecycle(String transType) {
		String time = "";
		try {
			Properties props = new Properties();
			InputStream in = OrderLifecycleUtil.class.getResourceAsStream(
					"/conf/order-lifecycle.properties");
			props.load(in);
			in.close();
			Set keyValue = props.keySet();

			for (Iterator it = keyValue.iterator(); it.hasNext();) {
				String key = (String) it.next();
				if(transType.equals(key)){
					String val = props.getProperty(key);
					time = val;
				}
				
			}
			return time;
		} catch (Exception e) {
			e.getStackTrace();
			return time;
		}

	}
}
